<?php

/**
 * DadosComerciais form base class.
 *
 * @package    form
 * @subpackage dados_comerciais
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseDadosComerciaisForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_dados_comerciais' => new sfWidgetFormInputHidden(),
      'no_empresa'          => new sfWidgetFormInput(),
      'ds_nome_fantasia'    => new sfWidgetFormInput(),
      'ds_razao_social'     => new sfWidgetFormInput(),
      'ds_atividade'        => new sfWidgetFormInput(),
      'st_atividade'        => new sfWidgetFormInput(),
      'id_dados_usuario'    => new sfWidgetFormDoctrineChoice(array('model' => 'DadosUsuario', 'add_empty' => false)),
      'nu_cnpj'             => new sfWidgetFormInput(),
      'nu_tempo_atividade'  => new sfWidgetFormInput(),
      'nu_funcionarios'     => new sfWidgetFormInput(),
      'nu_socios'           => new sfWidgetFormInput(),
      'tel_fixo'            => new sfWidgetFormInput(),
      'tel_fixo_extra'      => new sfWidgetFormInput(),
      'nu_icms'             => new sfWidgetFormInput(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_dados_comerciais' => new sfValidatorDoctrineChoice(array('model' => 'DadosComerciais', 'column' => 'id_dados_comerciais', 'required' => false)),
      'no_empresa'          => new sfValidatorString(array('max_length' => 200)),
      'ds_nome_fantasia'    => new sfValidatorString(array('max_length' => 200)),
      'ds_razao_social'     => new sfValidatorString(array('max_length' => 200)),
      'ds_atividade'        => new sfValidatorString(array('max_length' => 200)),
      'st_atividade'        => new sfValidatorString(array('max_length' => 1)),
      'id_dados_usuario'    => new sfValidatorDoctrineChoice(array('model' => 'DadosUsuario')),
      'nu_cnpj'             => new sfValidatorString(array('max_length' => 20)),
      'nu_tempo_atividade'  => new sfValidatorInteger(),
      'nu_funcionarios'     => new sfValidatorInteger(array('required' => false)),
      'nu_socios'           => new sfValidatorInteger(),
      'tel_fixo'            => new sfValidatorString(array('max_length' => 15)),
      'tel_fixo_extra'      => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'nu_icms'             => new sfValidatorString(array('max_length' => 15)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('dados_comerciais[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'DadosComerciais';
  }

}
